<?php require_once('header.php'); ?>
<?php //include_once('topwidget.php'); ?>

<div id="contentBox">
<?php include_once('sidebar.php'); ?>

<div id="content">
<h1>All Projects</h1>
<?php
	$prjid = $_GET['prjid'];
	$singlePrjQuery = "SELECT * FROM projects, subcategories WHERE psubcatid=scid AND pid = $prjid";
	connection();
	$singlePrj = mysql_query($singlePrjQuery);
	
	while($prj = mysql_fetch_array($singlePrj)) {
?>

    <h3><a href="project.php?prjid=<?php echo $prj['pid']; ?>"><?php echo $prj['ptitle']; ?></a></h3>
        <p><?php echo $prj['pdescription']; ?></p>
	<div class="projectBox">
    	<span class="posted">Est. Budget: $<?php echo $prj['pbudget']; ?></span>
		<span class="categoryBtn"><?php echo $prj['cname']; ?></span>
        <span class="categoryBtn">Posted: <?php echo $prj['pposteddate']; ?></span>
        <span class="categoryBtn">End Date: <?php echo $prj['penddate']; ?></span>
	</div><br />
        <a class="oBtn inneroBtnPrimary" href="bid.php?projectid=<?php echo $prj['pid']; ?>">Apply</a>

<?php
	}
?>

</div>
<div style="clear:both;"></div>

<?php //include_once('bottomwidget.php'); ?>
<?php include_once('footer.php'); ?>